home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / include / pexec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-07  |  1.4 KB  |  57 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1989, Tera Computer Company
  5.  **/
  6.  
  7.   /* header for executing predicates */
  8.  
  9. #ifndef pexec_h
  10. #define pexec_h
  11.  
  12. #include "attribute.h"
  13. #include "digraph.h"
  14.  
  15. typedef char * GELEMENT;    /* either an (OUTEDGE *) or a (NODE *) */
  16.  
  17. typedef struct lelem LELEMENT;
  18.  
  19. typedef struct lelem         /* list of graph elements */
  20. {            
  21.     BOOL node;            /* if false, it's an edge */
  22.     GELEMENT gelement;        /* the graph element */
  23.     NODE *from;            /* head of an outedge 
  24.                    (if the element is an edge) */
  25.     LELEMENT *next;        /* next in the list */
  26. };
  27.  
  28.   /* shorthand for those tedious conditions which must be checked */
  29.  
  30.   /* if the routine returns no value */
  31. #define exec_ck \
  32.     if (exec_error || pbroken || pcontinued) return;
  33.  
  34.   /* if the routine returns a boolean */
  35. #define exec_ckb \
  36.     if (exec_error || pbroken || pcontinued) return FALSE;
  37.  
  38.   /* if the routine returns a pointer */
  39. #define exec_ckp \
  40.     if (exec_error || pbroken || pcontinued) return NULL;
  41.  
  42.   /**
  43.      step through all nodes, but ignore coalesced nodes, and null nodes,
  44.      and, if ignoreHidden is true, hidden nodes.
  45.    **/
  46. #define    each_pred_node(digraph, node)    \
  47.    {\
  48.       VNO _vno;\
  49.       for (_vno = 0; _vno <= digraph->lastnode; _vno++)\
  50.       {\
  51.       node = Node(digraph, _vno); \
  52.      if (node == NULL || Coalesced(node) || \
  53.          (ignoreHidden && !Displayed(node))) \
  54.          continue;
  55.  
  56. #endif
  57.